package cn.mysource.org.domain;

import cn.mysource.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {

//    private Long id;
    private String sn;
    private String name;
    private String dirPath;
    private Integer state;
    private Long managerId;
    private Long parentId;
    private Long shopId;

    // 负责人
    private Employee  manager;
    // 上级部门
    private Department parent;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)//当前集合数据不为空就返回json，为空则不返回
    private List<Department> children = new ArrayList<>();


    private String methodName;
    private String hostAddress;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT + 8")
    private Date date;



}
